/**
 * Defines an abstract logger that does nothing but no error when called :)
 * @namespace Archetype.Loggers.AbstractLogger
 * @namespace Archetype.Loggers.NullLogger
 * @author temsa
 */
Archetype.Loggers.AbstractLogger = {
    initialize: _,
    name: Archetype.Logger,
    log:	_,
    debug:	_,
    warn:	_,
    error:	_,
    fatal:	_,
    /**
     * @return what should be logged, prepending, if available method name and package name
     */
    _getArgs: function() {
        var args = $A();
        try {
            var caller = arguments.callee.caller;
            if($exist(caller))
                args = $A(caller.arguments);
            var methodName = this._getCallerName(caller);
            if (methodName != "") {
                methodName = "["+methodName+"]";
                args.unshift(methodName);
            }
        } catch(e) {
            //Logger.debug("error resolving caller name for logging: ",e);
        }
        return args;
    },

    _getCallerName : function(caller) {
        var i = 0;
        var methodName = "";
        while ($exist(caller) && methodName == ""
               && caller.arguments.callee.caller != null && i < 3) {
            if(typeof caller.arguments.callee.caller.name != "undefined") {
                methodName = caller.arguments.callee.caller.name;
            }
            caller = caller.arguments.callee.caller;
            i++;
        }
        return methodName;
    }
};